﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master" CodeBehind="CustomerMaster.aspx.vb" Inherits="I_PORT.CustomerMaster" 
    title="IRPC INTELLIGENT PORT SERVICE" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
        function closeModal() {
           document.getElementById('ctl00_contentplaceholder1_framePopup').src = '../MasterPopup/Customer_Popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnLoad').click();
        }
        function showPopup() {
             document.getElementById('ctl00_contentplaceholder1_framePopup').contentWindow.location.reload(true);
        }
</script>
<asp:UpdatePanel ID="Update1" runat="server">
  <ContentTemplate>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
             <td style="width:20%;" align="right"><asp:Label ID="lbNameCustomer" runat="server" SkinID="lbtxt" Text="Customer :"></asp:Label>&nbsp;</td>
             <td align="left"><asp:TextBox ID="txtCustomer" runat="server"></asp:TextBox>
             <asp:Button ID="btnSearch" runat="server" Text="ค้นหา" CssClass="ButtonStyle" />
             </td>
        </tr>
        <tr>
           <td style="height:5px;"><img src="../Image/space.gif" /></td>
        </tr>
        <tr>
           <td align="center" colspan="2">
              <asp:UpdatePanel ID="updatePanelGrid" runat="server" UpdateMode="Conditional"><ContentTemplate>
              <asp:GridView ID="gridCustomer" runat="server" SkinID="gridblue"  DataKeyNames="Customer_no,Name,STREET,STR_SUPPL3,LOCATION,District,Postal_Code,City,Default_Pay"
                     AutoGenerateColumns="False">
                     <PagerTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="ImgFirst" runat="server" Height="22px" ImageUrl="../Image/arrow-first.gif"
                                                            OnCommand="Paginate" CommandArgument="First" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                    </td>
                                                    <td valign="top">
                                                        Page
                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        of
                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </PagerTemplate>
                     <Columns> 
                         <asp:BoundField HeaderText="No." DataField="Customer_no" />
                         <asp:BoundField HeaderText="Name" DataField="Name" />
                         <asp:BoundField HeaderText="City" DataField="City" />
                         <asp:TemplateField HeaderText="แก้ไข" ItemStyle-Width="50px">
                             <ItemTemplate>
                                 <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" ImageUrl="~/Image/edit-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
               </ContentTemplate></asp:UpdatePanel>
           </td>
        </tr>
        <tr>
           <td style="height:5px;"><img src="../Image/space.gif" /></td>
        </tr>
        <tr>
           <td style="width:20%;" align="right"></td>
           <td align="left"><asp:Button ID="btnUpdate" runat="server" Text="Update Customer" Width="140px" CssClass="ButtonStyle" /></td>
        </tr>
     </table>
     <asp:Button ID="btnAdd" runat="server" Text="" style="display:none" />
      <asp:Button ID="btnLoad" runat="server" Text="ปิด" style="display:none;" />
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnAdd" PopupControlID="PopupAdd" >
    </asp:ModalPopupExtender>
    <asp:Panel ID="PopupAdd" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="framePopup" class="Style-Iframe" marginheight="0px" marginwidth="0px" src="../MasterPopup/Customer_Popup.aspx" >
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
  </ContentTemplate>
</asp:UpdatePanel>
<%--<script type="text/javascript"> 
tabdropdown.init("colortab", 2)
</script>--%>
</asp:Content>
